package com.wenhai.springbook.factorybean;

import org.springframework.beans.factory.FactoryBean;

public class CarFactoryBean implements FactoryBean<Car> {

    private String carName;

    public String getCarName() {
        return carName;
    }

    public void setCarName(String carName) {
        this.carName = carName;
    }

    @Override
    public Car getObject() throws Exception {
        System.out.println("getObject car starting");
        Car car = new Car();
        car.setName(carName);
        return car;
    }

    @Override
    public Class<?> getObjectType() {
        return Car.class;
    }

}
